package me.vudu.Conflict.Listeners.Skills;

import me.vudu.Conflict.ConflictPlugin;

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.getspout.spoutapi.player.SpoutPlayer;


/**
 * NOT USED!!!!!!!!!!!!!!!!
 * 
 * @author vwendel
 *
 */
public class PlayerSkillMoveListener implements Listener{

	ConflictPlugin plugin;
	
	public PlayerSkillMoveListener(ConflictPlugin plugin){
		Bukkit.getServer().getPluginManager().registerEvents(this, plugin);
		this.plugin=plugin;
	}

	@EventHandler(priority = EventPriority.HIGH)
	public void onPlayerMoveEvent(PlayerMoveEvent event){
		
		
		
		SpoutPlayer player = (SpoutPlayer) event.getPlayer();	
		
		
		//player.sendMessage(Double.toString(player.getJumpingMultiplier()));
		//player.sendMessage(Integer.toString(player.getBuildVersion()));
		//Rennen -> moved to...
		if (ConflictPlugin.skillFightSpeedLand.get(player.getName()) > 0){ //Rennen 1
			//player.setWalkingMultiplier(1.2);
		}
		if (ConflictPlugin.skillFightSpeedLand.get(player.getName()) > 1){ //Rennen 2
			//player.setWalkingMultiplier(1.4);
		}
		
		//Springen
		if (ConflictPlugin.skillFightJump.get(player.getName()) > 0){ //Springen
			//player.setJumpingMultiplier(1.5);
		}
		
		
		//Schwimmen
//		if (playerLocation.getBlock().getType().equals(Material.STATIONARY_WATER))
//		{
//			
			if (ConflictPlugin.skillFightSpeedWater.get(player.getName()) > 0){	//Schwimmen 1
//				Vector dir = player.getLocation().getDirection().normalize().multiply(1.5 - 1.6D);
//				Vector vec = new Vector(dir.getX(), dir.getY(), dir.getZ());
//				player.setVelocity(vec);
				player.setSwimmingMultiplier(0.1);
			}
			if (ConflictPlugin.skillFightSpeedWater.get(player.getName()) > 1){//Schwimmen 2
//				Vector dir = player.getLocation().getDirection().normalize().multiply(2.0 - 1.6D);
//				Vector vec = new Vector(dir.getX(), dir.getY(), dir.getZ());
//				player.setVelocity(vec);
				player.setSwimmingMultiplier(0.1);
			}
//		}
		
		
		
	}
	
	
	
	
	
	
} 